home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / text / faqs / linux.howto.ethernet.part2 < prev    next >
Encoding:
Internet Message Format  |  1994-04-26  |  36.7 KB

  1. Subject: Linux Ethernet HOWTO (part 2/2)
  2. Newsgroups: comp.os.linux.announce,comp.os.linux.admin,comp.answers,news.answers
  3. From: Paul Gortmaker <gpg109@rsphysse.anu.edu.au>
  4. Date: Mon, 25 Apr 1994 19:40:27 GMT
  5.  
  6. Archive-Name: linux/howto/ethernet/part2
  7. Last-modified: 15 Apr 94
  8.  
  9.  
  10. ---This is part 2/2---
  11.  
  12. 5.06 Programming the Intel chips (i82586 and i82593)
  13.  
  14.     These chips are used on a number of cards, namely the 3c507 ('86),
  15.     the Intel EtherExpress 16 ('86), Microdyne's exos205t ('86),
  16.     the Z-Note ('93), and the Racal-Interlan ni5210 ('86).
  17.  
  18.     Russ Nelson writes:
  19.     "Most boards based on the 82586 can reuse quite a bit of their code.
  20.     More, in fact, than the 8390-based adapters. There are only three
  21.     differences between them:
  22.  
  23.       o The code to get the Ethernet address,
  24.       o The code to trigger CA on the 82586, and
  25.       o The code to reset the 82586.
  26.  
  27.     The Intel EtherExpress 16 is an exception, as it I/O maps the 82586.
  28.     Yes, I/O maps it. Fairly clunky, but it works.
  29.  
  30.     Garrett Wollman did an AT&T driver for BSD that uses the BSD
  31.     copyright. The latest version I have (Sep '92) only uses a single
  32.     transmit buffer. You can and should do better than this if you've
  33.     got the memory. The AT&T and 3c507 adapters do; the ni5210 doesn't.
  34.  
  35.     The people at Intel gave me a very big clue on how you queue up
  36.     multiple transmit packets. You set up a list of
  37.     NOP->XMIT->NOP->XMIT->NOP->XMIT->(beginning) blocks, then you set the
  38.     "next" pointer of all the NOP blocks to themselves. Now you start
  39.     the command unit on this chain. It continually processes the first
  40.     NOP block. To transmit a packet, you stuff it into the next transmit
  41.     block, then point the NOP to it. To transmit the next packet, you
  42.     stuff the next transmit block and point the previous NOP to *it*. In
  43.     this way, you don't have to wait for the previous transmit to finish,
  44.     you can queue up multiple packets without any ambiguity as to whether
  45.     it got accepted, and you can avoid the command unit start-up delay."
  46.  
  47. 5.07    Technical information from 3Com
  48.  
  49.     From: Cameron Spitzer 764-6339 <camerons@nad.3com.com>
  50.     Subject: getting 3Com Adapter manuals
  51.     Date: Mon, 27 Sep 1993 21:17:07 +0200
  52.     
  53.     Since this is becoming a FAQ, I'm going to tread the thin
  54.     ice of No Commercial Use and answer it here.
  55.  
  56.     3Com's Ethernet Adapters are documented for driver writers
  57.     in our "Technical References" (TRs). These manuals describe
  58.     the programmer interfaces to the boards but they don't talk
  59.     about the diagnostics, installation programs, etc that end
  60.     users can see.
  61.     
  62.     The Network Adapter Division marketing department has the
  63.     TRs to give away. To keep this program efficient, we
  64.     centralized it in a thing called "CardFacts." CardFacts is
  65.     an automated phone system. You call it with a touch-tone
  66.     phone and it faxes you stuff. To get a TR, call CardFacts
  67.     at 408-727-7021. Ask it for Developer's Order Form,
  68.     document number 9070. Have your fax number ready when you
  69.     call. Fill out the order form and fax it to 408-764-5004.
  70.     Manuals are shipped by Federal Express 2nd Day Service.
  71.     
  72.     If you don't have a fax and nobody you know has a fax,
  73.     really and truly, *then* send mail to
  74.     Terry_Murphy@3Mail.3Com.com and tell her about your problem.
  75.     PLEASE use the fax thing if you possibly can.
  76.     
  77.     After you get a manual, if you still can't figure out how to
  78.     program the board, try our "CardBoard" BBS at
  79.     1-800-876-3266, and if you can't do that, write
  80.     Andy_Chan@3Mail.3com.com and ask him for alternatives. If
  81.     you have a real stumper that nobody has figured out yet, the
  82.     fellow who needs to know about it is
  83.     Steve_Lebus@3Mail.3com.com.
  84.     
  85.     There are people here who think we are too free with the
  86.     manuals, and they are looking for evidence that the system
  87.     is too expensive, or takes too much time and effort. That's
  88.     why it's important to try to use CardFacts *before* you
  89.     start calling and mailing the people I named here.
  90.     
  91.     There are even people who think we should be like Diamond
  92.     and Xircom, requiring tight "partnership" with driver
  93.     writers to prevent poorly performing drivers from getting
  94.     written. So far, 3Com customers have been really good about
  95.     this, and there's no problem with the level of requests
  96.     we've been getting. We need your continued cooperation and
  97.     restraint to keep it that way.
  98.     
  99.     Cameron Spitzer, 408-764-6339
  100.     3Com NAD
  101.     Santa Clara
  102.     work: camerons@nad.3com.com
  103.     home: cls@truffula.sj.ca.us
  104.  
  105. 5.08 Notes on AMD PCnet-ISA / LANCE Based cards (79C960)
  106.  
  107.     The AMD LANCE (Local Area Network Controller for Ethernet)
  108.     was the original offering, and has since been replaced by
  109.     the "PCnet-ISA" chip, otherwise known as the 79C960.
  110.     A relatively new chip from AMD, the 79C960, is the heart of many
  111.     new cards being released at present. Note that the name "LANCE"
  112.     has stuck, and some people will refer to the new chip by the old
  113.     name. Dave Roberts of the Network Products Division of AMD was kind
  114.     enough to contribute the following information regarding this chip:
  115.  
  116.     "As for the architecture itself, AMD developed it originally
  117.     and reduced it to a single chip -- the PCnet(tm)-ISA -- over a year
  118.     ago. It's been selling like hotcakes ever since.
  119.  
  120.     Functionally, it is equivalent to a NE1500. The register set
  121.     is identical to the old LANCE with the 1500/2100 architecture
  122.     additions. Older 1500/2100 drivers will work on the PCnet-ISA.
  123.     The NE1500 and NE2100 architecture is basically the same.
  124.     Initially Novell called it the 2100, but then tried to distinguish
  125.     between coax and 10BASE-T cards. Anything that was 10BASE-T only was
  126.     to be numbered in the 1500 range. That's the only difference.
  127.  
  128.     Many companies offer PCnet-ISA based products, including HP,
  129.     Racal-Datacom, Allied Telesis, Boca Research, Kingston Technology, etc.
  130.     The cards are basically the same except that some manufacturers
  131.     have added "jumperless" features that allow the card to
  132.     be configured in software. Most have not. AMD offers a standard
  133.     design package for a card that uses the PCnet-ISA and many
  134.     manufacturers use our design without change.
  135.     What this means is that anybody who wants to write drivers for
  136.     most PCnet-ISA based cards can just get the data-sheet from AMD. Call
  137.     our literature distribution center at (800)222-9323 and ask for the
  138.     Am79C960, PCnet-ISA data sheet. It's free.
  139.  
  140.     A quick way to understand whether the card is a "stock" card
  141.     is to just look at it. If it's stock, it should just have one large
  142.     chip on it, a crystal, a small IEEE address PROM, possibly a socket
  143.     for a boot ROM, and a connector (1, 2, or 3, depending on the media
  144.     options offered). Note that if it's a coax card, it will have some
  145.     transceiver stuff built onto it as well, but that should be near the
  146.     connector and away from the PCnet-ISA.
  147.  
  148.     The PCnet-ISA is faster than the original LANCE design and
  149.     makes better use of the available bus bandwidth. Additionally, some
  150.     LANCE bugs were corrected and many enhancements were made."
  151.  
  152.     There is also some info regarding the LANCE chip in the file
  153.     lance.c which is included in the standard kernel.
  154.  
  155. 5.09 Multicast and Promiscuous mode
  156.  
  157.     One of the things I've been working on recently is the
  158.     major remaining item on the ethercard feature list:
  159.     implementing multicast and promiscuous mode hooks.
  160.     
  161.     At first I was planning to do it while implementing either
  162.     the /dev/* or DDI interface, but that's not really the
  163.     correct way to do it. We should only enable multicast or
  164.     promiscuous modes when something wants to look at the
  165.     packets, and shut it down when that application is
  166.     finished, neither of which is strongly related to when the
  167.     hardware is opened or released.
  168.     
  169.     I'll start by discussing promiscuous mode, which is
  170.     conceptually easy to implement. For most hardware you
  171.     only have to set a register bit, and from then on you get
  172.     every packet on the wire. Well, it's almost that easy;
  173.     for some hardware you have to shut the board (potentially
  174.     dropping a few packet), reconfigure it, and then re-enable
  175.     the ethercard. This is grungy and risky, but the
  176.     alternative seems to be to have every application register
  177.     before you open the ethercard at boot-time.
  178.     
  179.     OK, so that's easy, so I'll move on something that's not
  180.     quite so obvious: Multicast. It can be done two ways:
  181.     
  182.     1) Use promiscuous mode, and a packet filter like the
  183.        Berkeley packet filter (BPF). The BPF is a pattern matching
  184.        stack language, where you write a program that picks out the
  185.        addresses you are interested in. Its advantage is that it's
  186.        very general and programmable. Its disadvantage is that there
  187.        is no general way for the kernel to avoid turning on promiscuous
  188.        mode and running every packet on the wire through every registered
  189.        packet filter. See the next section for more information on BPF.
  190.     
  191.     2) Using the built-in multicast filter that most etherchips have.
  192.     
  193.     I guess I should list what a few ethercards/chips provide:
  194.     
  195.     Chip/card  Promiscuous    Multicast filter
  196.     ========================================
  197.     Seeq8001/3c501    Yes    Binary filter (1)
  198.     3Com/3c509    Yes    Binary filter (1)
  199.     8390        Yes    Autodin II six bit hash (2) (3)
  200.     LANCE        Yes    Autodin II six bit hash (2) (3)
  201.     i82586        Yes    Hidden Autodin II six bit hash (2) (4)
  202.     
  203.     
  204.     (1) These cards claim to have a filter, but it's a simple
  205.     yes/no 'accept all multicast packets', or 'accept no
  206.     multicast packets'.
  207.     
  208.     (2) AUTODIN II is the standard ethernet CRC (checksum)
  209.     polynomial. In this scheme multicast addresses are hashed
  210.     and looked up in a hash table. If the corresponding bit
  211.     is enabled, this packet is accepted. Ethernet packets are
  212.     laid out so that the hardware to do this is trivial -- you
  213.     just latch six (usually) bits from the CRC circuit (needed
  214.     anyway for error checking) after the first six octets (the
  215.     destination address), and use them as an index into the
  216.     hash table (six bits == a 64-bit table).
  217.     
  218.     (3) These chips use the six bit hash, and must have the
  219.     table computed and loaded by the host. This means the
  220.     kernel must include the CRC code.
  221.     
  222.     (4) The 82586 uses the six bit hash internally, but it
  223.     computes the hash table itself from a list of multicast
  224.     addresses to accept.
  225.  
  226.     Note that none of these chips do perfect filtering, and we
  227.     still need a middle-level module to do the final
  228.     filtering. Also note that in every case we must keep a
  229.     complete list of accepted multicast addresses to recompute
  230.     the hash table when it changes.
  231.     
  232.     My first pass at device-level support is detailed in the
  233.     new outline driver skeleton.c (pl14 and up.)
  234.  
  235.     It looks like the following:
  236.     
  237.     #ifdef HAVE_MULTICAST
  238.     static void set_multicast_list(struct device *dev, int num_addrs,
  239.                      void *addrs);
  240.     #endif
  241.     .
  242.     .
  243.     
  244.     ethercard_open() {
  245.     ...
  246. #ifdef HAVE_MULTICAST
  247.         dev->set_multicast_list = &set_multicast_list;
  248.     #endif
  249.     ...
  250.     
  251.     #ifdef HAVE_MULTICAST
  252.     /* Set or clear the multicast filter for this adaptor.
  253.        num_addrs == -1    Promiscuous mode, receive all packets
  254.        num_addrs == 0    Normal mode, clear multicast list
  255.        num_addrs > 0    Multicast mode, receive normal and
  256.                 MC packets, and do best-effort filtering.
  257.      */
  258.     static void
  259.     set_multicast_list(struct device *dev, int num_addrs, void *addrs)
  260.     {
  261.     ...
  262.  
  263.     Any comments, criticism, etc. are welcome.
  264.  
  265.     Alan Cox adds that "...in pl14, user programs can access promiscuous
  266.     mode but not multicast mode, even though the drivers support both.
  267.     The ifconfig program allows you to mark an interface 'promisc'."
  268.     
  269. 5.10 The Berkeley Packet Filter (BPF)
  270.  
  271.     I'm not bitterly opposed to it, but I'm coming to the
  272.     conclusion that the 'bpf' functionality should not be provided
  273.     by the kernel, but should be in a (hopefully little-used)
  274.     compatibility library.
  275.     
  276.     For those not in the know: 'bpf' (the Berkeley Packet Filter)
  277.     is an mechanism for specifying to the kernel networking layers
  278.     what packets you are interested in. It's implemented as a
  279.     specialized stack language interpreter built into a low level
  280.     of the networking code. An application passes a program
  281.     written in this language to the kernel, and the kernel runs the
  282.     program on each incoming packet. If the kernel has multiple
  283.     'bpf' applications, each program is run on each packet.
  284.     
  285.     The problem is that it's difficult to deduce what kind of
  286.     packets the application is really interested in from the packet
  287.     filter program, so the general solution is to always run the
  288.     filter. Imagine a program that registers a 'bpf' program to
  289.     pick up a low data-rate stream sent to a multicast address.
  290.     Most ethernet cards have a hardware multicast address filter
  291.     implemented as a 64 entry hash table that ignores most unwanted
  292.     multicast packets, so the capability exists to make this a very
  293.     inexpensive operation. But with the BFP the kernel must switch
  294.     the interface to promiscuous mode, receive _all_ packets, and
  295.     run them through this filter. This is work, BTW, that's very
  296.     difficult to account back to the process requesting the packets.
  297.  
  298. 5.11 Unresolved questions / concerns
  299.  
  300.     There may be some benefit from processing packet data as it is
  301.     transferred to and from the ethercard, especially with very fast
  302.     processors transferring data to a slow ethercard. As I see it this
  303.     question has multiple parts:
  304.         1) Is there any useful processing power available, perhaps
  305.            during the ISA bus recovery period, or while the 8390
  306.            remote DMA is preparing for another transfer??
  307.         2) Is there any useful but simple work that can be done
  308.            between/during each word of the copy, such as calculating
  309.            a CRC, or discarding obviously unwanted packets??
  310.         3) would the complexity of an interface to do this make future
  311.            ethercard drivers impossible??
  312.  
  313.     There should be a better structure than Space.c - Drivers should be
  314.     able to autoprobe for all installed ethercards rather than just
  315.     quitting after finding the first.  I've written code to do this,
  316.     but the constant promise (threat?) of DDI has prevented me from
  317.     making it standard.
  318.  
  319.     A related topic is the problem of driver probes corrupting
  320.     unrelated hardware. Even worse is a probe into a dataport that
  321.     isn't set up to transfer data, which will freeze the machine. The
  322.     common suggestion is a boot-time device registry that records
  323.     already-used I/O ports and shared memory. This has been implemented
  324.     as of pl13, see section 5.01.
  325.  
  326. 6 Possible problems, and troubleshooting.
  327.  
  328.     This section tries to answer any unresolved questions, and not so
  329.     common solutions to common problems. They are sorted on a "per
  330.     manufacturer basis". You should have also read the relevant info.
  331.     from section 1 about your specific card. Section 8 contains more
  332.     general FAQ's.
  333.  
  334. 6.01 Problems with NE2000 (and clones)
  335.  
  336.     "DMA address mismatch"
  337.     ======================
  338.  
  339.     Is the chip a real NatSemi 8390? (DP8390, DP83901, DP83902 or DP83905)?
  340.     If not, some clone chips don't correctly implement the transfer
  341.     verification register. MS-DOS drivers never do error checking,
  342.     so it doesn't matter to them.
  343.  
  344.     Are most of the messages off by a factor of 2?
  345.     If so:    Are you using the NE2000 in a 16 bit slot?
  346.         Is it jumpered to use only 8 bit transfers?
  347.  
  348.     The Linux driver expects a NE2000 to be a 16 bit slot. A NE1000 can
  349.     be in either size slot. This problem can also occur with some clones,
  350.     notably D-Link 16 bit cards, that don't have the correct ID bytes
  351.     in the station address PROM. [[ This should be fixed in pl12.]]
  352.  
  353.     Are you running the bus faster than 8Mhz?
  354.     If you can change the speed (faster or slower), see if that
  355.     makes a difference. Most NE2000 clones will run at 16Mhz, but
  356.     some may not. Changing speed can also mask a noisy bus.
  357.  
  358.     What other devices are on the bus?
  359.     If moving the devices around changes the reliability, then you
  360.     have a bus noise problem -- just what that error message was
  361.     designed to detect. Congratulations, you've probably found the
  362.     source of other problems as well.
  363.  
  364.     Machine Hangs during Boot.
  365.     ==========================
  366.  
  367.     Problem:  The machine hangs during boot right after the "8390..."  or
  368.           "WD...." message. Removing the NE2000 fixes the problem.
  369.  
  370.     Solution: Change your NE2000 base address to 0x360 (or 0x340 for
  371.           pl12 or later kernels.) Alternatively, you can use the new
  372.           device registrar implemented in pl13 (see section 5.1)
  373.  
  374.     Reason:   Your NE2000 clone isn't a good enough clone. An active
  375.           NE2000 is a bottomless pit that will trap any driver
  376.           autoprobing in its space. The other ethercard drivers take
  377.           great pain to reset the NE2000 so that it's safe, but some
  378.           clones cannot be reset. Clone chips to watch out for:
  379.           Winbond 83C901. Changing the NE2000 to a less-popular
  380.           address will move it out of the way of other autoprobes,
  381.           allowing your machine to boot.
  382.  
  383.     Problem:  The machine hangs during the SCSI probe at boot.
  384.  
  385.     Solution: It's the same problem as above, change the
  386.           ethercard's address, or use the device registrar.
  387.  
  388.     Problem:  The machine hangs during the soundcard probe at boot.
  389.  
  390.     Solution: No, that's really during the silent SCSI probe, and it's
  391.           the same problem as above.
  392.  
  393.     "eth0: DMAing conflict in ne_block_input"
  394.     =========================================
  395.  
  396.     This bug came from timer-based packet retransmissions. If you got a
  397.     timer tick _during_ a ethercard RX interrupt, and timer tick tried to
  398.     retransmit a timed-out packet, you could get a conflict. Because of
  399.     the design of the NE2000 you would have the machine hang (exactly the
  400.     same the NE2000-clone boot hangs).
  401.  
  402.     Early versions of the driver disabled interrupts for a long time,
  403.     and didn't have this problem. Later versions are fixed. (ie. kernels
  404.     after 0.99p9 should be OK.)
  405.  
  406.     NE2000 not detected at boot.
  407.     ============================
  408.  
  409.     A few people have reported a problem with detecting the Accton NE2000.
  410.     This problem occurs only at boot-time, and the card is later detected
  411.     at run-time by the identical code my (alpha-test) ne2k diagnostic
  412.     program. Accton has been very responsive, but I still haven't tracked
  413.     down what is going on. I've been unable to reproduce this problem
  414.     with the Accton cards we purchased. If you are having this problem,
  415.     please send me an immediate bug report. For that matter, if you have
  416.     an Accton card send me a success report, including the type of the
  417.     motherboard. I'm especially interested in finding out if this problem
  418.     moves with the particular ethercard, or stays with the motherboard.
  419.     
  420.     Here are some things to try, as they have fixed it for some people:
  421.     1) Change the bus speed, or just move the card to a different slot (!).
  422.     2) Change the "I/O recovery time" parameter in the BIOS
  423.        chipset configuration.
  424.     3) Make the following code change suggested by David Cutler,
  425.        <dave@dmitri.ucdavis.edu> to ne.c around line 150:
  426.  
  427.         for(i = 0; i < 32 /*sizeof(SA_prom)*/; i+=2) {
  428.     -        SA_prom[i] = inb_p(ioaddr + NE_DATAPORT);
  429.     -        SA_prom[i+1] = inb_p(ioaddr + NE_DATAPORT);
  430.     +        SA_prom[i] = inb(ioaddr + NE_DATAPORT);
  431.     +        SA_prom[i+1] = inb(ioaddr + NE_DATAPORT);
  432.             if (SA_prom[i] != SA_prom[i+1])
  433.                 wordlength = 1;
  434.         }
  435.  
  436.     Yes, this removes the delay between board accesses, something that
  437.     would normally increase the likelihood of data corruption rather
  438.     than decreasing it. Note that this change is already incorporated
  439.     into pl15. If you have an older kernel, you may have to do it
  440.     yourself.
  441.  
  442. 6.02 Problems with WD80*3 cards
  443.  
  444.     Detected Non-existent Ethercard
  445.     ===============================
  446.  
  447.     Problem:  A WD80*3 is falsely detected. Removing the sound or
  448.           MIDI card eliminates the "detected" message.
  449.  
  450.     Solution: Update your ethercard driver: new versions include an
  451.           additional sanity check.
  452.  
  453.     Reason:   Some MIDI ports happen to produce the same checksum as a
  454.           WD ethercard.
  455.  
  456.     Error messages from the 80*3
  457.     ============================
  458.  
  459.     Problem:  You get messages such as the following with your 80*3:
  460.             eth0: bogus packet size, status = ........
  461.             kmalloc called with impossibly large argument (65400)
  462.             eth0: Couldn't allocate sk_buff of size 65400
  463.             eth0: receiver overrun
  464.  
  465.     Reason:   There is a shared memory problem.
  466.  
  467.     Solution: If the problem is sporadic, you have hardware problems.
  468.           Typical problems that are easy to fix are board conflicts,
  469.           having cache or "shadow ROM" enabled for that region, or
  470.           running your bus faster than 8Mhz. There are also a
  471.           surprising number of memory failures on ethernet cards,
  472.           so run a diagnostic program if you have one for your
  473.           ethercard.
  474.  
  475.           If the problem is continual, and you have have to reboot
  476.           to fix the problem, record the boot-time probe message
  477.           and mail it to becker@super.org - Take particular note of
  478.           the shared memory location.
  479.  
  480.     Will not detect my 80x3
  481.     =======================
  482.  
  483.     Reason:   The Mitsumi CD-ROM (mcd) driver probe at 0x300 will
  484.           succeed if just about *anything* is that I/O location.
  485.           This is bad news and needs to be a bit more robust. (pl15)
  486.           Once another driver registers that it "owns" an I/O
  487.           location, other drivers (incl. the wd80x3) are "locked
  488.           out" and can not probe that addr for a card.
  489.  
  490.     Solution: Recompile a new kernel without any excess drivers that
  491.           you aren't using, including the above mcd driver.
  492.           Or try moving your ethercard to a new I/O addr. Valid
  493.           I/O addr. for all the cards are listed in section 5.1
  494.           You can also point the mcd driver off in another direction
  495.           by a boot-time parameter (via LILO) such as:
  496.             "mcd=0x200,12"
  497.  
  498. 6.03 Problems with 3Com cards
  499.  
  500.     Choosing the Interrupt of the 3c503
  501.     ===================================
  502.  
  503.     Problem:  The 3c503 picks IRQ n at boot, but this is needed for some
  504.           other device which needs IRQ n. (eg. CD ROM driver, etc.)
  505.           Can this be fixed without compiling this into the kernel?
  506.  
  507.     Solution: The 3c503 driver probes for a free IRQ line in the order
  508.           {5, 9/2, 3, 4}, and it should pick a line which isn't being
  509.           used. The pre-pl12 (SLS 1.02) driver picked the IRQ line
  510.           at boot-time, and the current driver (pl12) chooses when
  511.           the card is open()/'ifconfig'ed. Note the "bug" noted in
  512.           the 3c503 section in 1.01
  513.  
  514.           Alternately, you can fix the IRQ at boot by passing
  515.           parameters via LILO. The following selects IRQ9, base
  516.           location 0x300, <ignored value>, and if_port #1 (the
  517.           external transceiver).
  518.             lilo: linux ether=9,0x300,0,1,eth0
  519.  
  520.           The following selects IRQ3, probes for the base location,
  521.           <ignored value>, and the default if_port #0 (the internal
  522.           transceiver)
  523.             lilo: linux ether=3,0,0,0,eth0
  524.  
  525.     "3c503: Configured interrupt number XX is out of range."
  526.     ========================================================
  527.  
  528.     Problem:  Whoever built your kernel fixed the ethercard IRQ at XX.
  529.  
  530.     Reason:   The above is truly evil, and worse than that, it is
  531.           not necessary. The 3c503 will autoIRQ when it gets
  532.           "ifconfig"ed, and pick one of IRQ{5, 2/9, 3, 4}.
  533.  
  534.     Solution: Use lilo to set the IRQ, or rebuild the kernel, enabling
  535.           autoIRQ by not specifying the IRQ line.
  536.  
  537.     Choosing the output of the 3c503
  538.     ================================
  539.  
  540.     Problem:  The supplied 3c503 drivers don't use the AUI (thicknet) port.
  541.           How does one choose it over the default thinnet port?
  542.  
  543.     Solution: The 3c503 AUI port can be selected at boot-time with 0.99pl12
  544.           and later. The selection is overloaded onto the low bit of
  545.           the currently-unused dev->rmem_start variable, so a boot-time
  546.           parameter of:
  547.             lilo: linux ether=0,0,0,1,eth0
  548.           should work. A boot line to force IRQ 5, port base 0x300,
  549.           and use an external transceiver is:
  550.             lilo: linux ether=5,0x300,0,1,eth0
  551.  
  552. 7 Networking with a laptop computer
  553.  
  554.     There are currently only a few ways to put your laptop on a network.
  555.     You can use the SLIP code (and run at serial line speeds);
  556.     you can buy one of the few laptops that come with a NE2000-compatible
  557.     ethercard or PCMCIA slot built-in; you can get a laptop with a
  558.     docking station and plug in an ISA ethercard; or you can use a
  559.     parallel port Ethernet adapter such as the D-Link DE-600.
  560.  
  561. 7.01 Option 1 -- using SLIP
  562.  
  563.     This is the cheapest solution, but by far the most difficult. Also,
  564.     you will not get very high transmission rates. Since SLIP is not
  565.     really related to ethernet cards, it will not be discussed further
  566.     here. See the NET-2 HOWTO.
  567.  
  568. 7.02 Option 2 -- Built in NE2000 compatible or PCMCIA Ethercard.
  569.  
  570.     The second solution severely limits your laptop choices and is fairly
  571.     expensive. Be sure to read the specifications carefully, you may find
  572.     that you will have to buy an additional non-standard transceiver to
  573.     actually put the machine on a network.
  574.  
  575.     As this area of Linux development is fairly young, I'd suggest
  576.     that you join the LAPTOPS mailing channel. See section 0.02
  577.     which describes how to join a mailing list channel. Try and
  578.     determine exactly what hardware you have (ie. card manufacturer,
  579.     PCMCIA chip controller manufacturer) and then ask on the LAPTOPS
  580.     channel. Regardless, don't expect things to be all that simple.
  581.     Expect to have to fiddle around a bit, and patch kernels, etc.
  582.     Maybe someday you will be able to type "make config" 8-)
  583.  
  584.     There is a number of programs on tsx-11.mit.edu in
  585.     /pub/linux/packages/laptops/ that you may find useful. These
  586.     range from PCMCIA Ethercard drivers to programs that communicate
  587.     with the PCMCIA controller chip. Note that these drivers are
  588.     usually tied to a specific PCMCIA chip (ie. the intel 82365
  589.     or the TCIC/2) On a brighter note, I know that people have used the
  590.     Linksys/D-Link 650 PCMCIA Ethernet PC Card with both controller
  591.     chipsets, so it *can* be done. I have also seen reports of
  592.     people using the IBM Credit Card Adapter for Ethernet with the
  593.     intel 82365 chip. This is all just from following the LAPTOPS
  594.     channel.
  595.  
  596.     The 3c589 from 3Com is supposed to look a lot like a 3c509.
  597.  
  598.     Anyway, the PCMCIA driver problem isn't specific to the Linux world.
  599.     It's been a real disaster in the MS-DOS world. In that world
  600.     people expect the hardware to work if they just follow the manual.
  601.     They might not expect it to interoperate with any other hardware
  602.     or software, or operate optimally, but they do expect that the
  603.     software shipped with the product will function. Many PCMCIA
  604.     adaptors don't pass this test.
  605.  
  606. 7.03 Option 3 -- ISA Ethercard in the Docking Station.
  607.  
  608.     I recommend the third solution. Docking stations for laptops typically
  609.     cost about $250 and provide two full-size ISA slots, two serial and one
  610.     parallel port. Most (all?) docking stations are powered off of the
  611.     laptop's batteries, and a few allow adding extra batteries in the
  612.     docking station if you use short ISA cards. You can add an inexpensive
  613.     ethercard and enjoy full-speed ethernet performance.
  614.  
  615. 7.04 Option 4 -- Pocket / parallel port adaptors.
  616.  
  617.     The "pocket" ethernet adaptors may also fit your need.
  618.     Until recently they actually costed more than a docking station and
  619.     cheap ethercard, and most tie you down with a wall-brick power supply.
  620.     At present, you can choose from the D-Link, or the RealTek adaptor.
  621.     Most other companies, especially Xircom, treat the programming
  622.     information as a trade secret, so support will likely be slow in
  623.     coming.
  624.  
  625.     You can sometimes avoid the wall-brick with the adaptors by buying
  626.     or making a cable that draws power from the laptop's keyboard
  627.     port. (This is mentioned in the info. for the AT-Lan-Tec unit.)
  628.  
  629.     The keyboard pinouts (5 pin DIN) are as follows:
  630.  
  631.         Signal/Function            Pin #
  632.         ---------------            -----
  633.         KEYCLK (clock)            1
  634.         KEYDAT (data)            2
  635.         N/C                3
  636.         Ground                4
  637.         +5 V                5
  638.  
  639.     A quick check with a voltmeter will verify which pins are 4 and 5
  640.     if you are not sure.
  641. 8 Frequently asked questions
  642.  
  643.     Here are some of the more frequently asked questions about using
  644.     Linux with an Ethernet connection. Some of the more specific
  645.     questions are sorted on a "per manufacturer basis" and are listed
  646.     in the "Troubleshooting" section. (section 6). However, since this
  647.     document is basically "old" by the time you get it, any "new" problems
  648.     will not appear here instantly. For these, I suggest that you make
  649.     efficient use of your newsreader. For example, nn users would type
  650.         nn -xX -s'3c'
  651.     to get all the news articles in your subscribed list that have
  652.     "3c" in the subject. (ie. 3com, 3c509, 3c503, etc.)
  653.     The moral: Read the man page for your newsreader.
  654.     
  655. 8.01 Just the FAQ's ma'am -- just the FAQ's.
  656.  
  657.     Q: I heard that there is an alpha driver available for my card.
  658.        Where can I get it?
  659.  
  660.     A: Assuming that it is a djb driver, it will be on ftp.super.org
  661.        in the /pub/linux/ area. Things change here quite frequently,
  662.        so just look around for it. There is usually only about 3
  663.        subdirs, so you should be able to find it. Now, if it really
  664.        is an alpha, or pre-alpha driver, then please treat it as
  665.        such. In other words, don't complain because you can't figure
  666.        out what to do with it. If you can't figure out how to install
  667.        it, then you probably shouldn't be testing it. Also, if it brings
  668.        your machine down, don't complain. Instead, send us a well
  669.        documented bug report, or even better, a patch!
  670.  
  671.     Q: Is there token ring support for Linux?
  672.  
  673.     A: No, there is no token ring support in Linux. To support token ring
  674.        requires more than only a writing a device driver, it also requires
  675.        writing the source routing routines for token ring. Given that
  676.        token ring is expensive, not fast, and will probably be swept away
  677.        by 100baseVG in a few months, it doesn't seem worth it to write
  678.        a driver. In case anyone wants to, I looked at writing a token ring
  679.        device driver, and concluded that the hardware interface
  680.        wasn't too difficult to do, but writing the support for source
  681.        routing would take significantly longer than I was willing to spend
  682.        on an expensive and dying technology.
  683.  
  684.        Alan Cox adds: "It will require [...] changes to the bottom socket
  685.        layer to support 802.2 and 802.2 based TCP/IP. Don't expect
  686.        anything soon."
  687.  
  688.     Q: Is there FDDI support for Linux?
  689.  
  690.     A: No, there is no Linux driver for any FDDI boards. I come from a
  691.        place with supercomputers, so an external observer might think
  692.        FDDI would be high on my list. But FDDI never delivered end-to-end
  693.        throughput that would justify its cost, and it seems to be a nearly
  694.        abandoned technology now that 100base{X,Anynet} seems imminent.
  695.        (And yes, I know you can now get FDDI boards for <$1K. That
  696.        seems to be a last-ditch effort to get some return on the
  697.        development investment. Where is the next generation of FDDI
  698.        going to come from?)
  699.  
  700.     Q: Can I link 10BaseT (RJ45) based systems together without a hub?
  701.  
  702.     A: You can link 2 machines easily, but no more than that, without
  703.        extra devices/gizmos. See section 4 on wiring -- it explains
  704.        how to do it. And no, you can't hack together a hub just by
  705.        crossing a few wires and stuff. It's pretty much impossible 
  706.        to do the collision signal right without duplicating a hub.
  707.  
  708.     Q: Is there IPX or Novell support available for Linux?
  709.  
  710.     A: Alan Cox writes: "The novell protocols are available from novell
  711.        for various amounts. IPX is freely documented. SPX is about $1000
  712.        but I'm told Xerox SPP is identical. _PLEASE_ has anyone got any
  713.        freely distributable Xerox SPP code/documentation? The novell
  714.        server spec costs you $15000 + royalties providing you only
  715.        want to write a client, or $30000 + royalties otherwise. Needless
  716.        to say the final output has to be binary only and subject to a
  717.        novell license. Reading their license rules by my interpretation
  718.        its also impossible for us to do because you would seem to have
  719.        to bar disassembly of your final result, which is not allowed
  720.        in the EEC.
  721.  
  722.        Bits of NCP are known, and I hope eventually enough will be known
  723.        to write limited NCP support into Linux, for the moment I'm poking
  724.        around at IPX, tho this will have to wait until the new network
  725.        code is finished.
  726.  
  727.        An Alpha test IPX protocol layer is available from me (Alan)
  728.        for pl14 or higher. People are also exploring the issue of NCP and
  729.        the new Dr Dobbs journal article on the innards of netware has
  730.        provided a core of good information."
  731.  
  732.        As an alternative, Miquel van Smoorenburg suggests the following:
  733.        "It _is_ possible to set up a dedicated PC running both novell and
  734.        the PD SOSS server and let it gateway from NFS to novell. This way
  735.        it is possible to mount the Novell drives on the Unix client.
  736.  
  737.        SOSS is a PD (perhaps with some restrictions, but freely available)
  738.        NFS server for DOS. It includes the PC/IP TCP/IP implementation
  739.        and runs on a packet driver. I have run both a Novell client
  740.        (with PDIPX, a Packet Driver IPX) and this SOSS server together
  741.        successfully."
  742.  
  743.        You can get "Stan's Own Server System" from the following location:
  744.         hilbert.wharton.upenn.edu:pub/tcpip/soss.zip
  745.        Note that this version has the IP bugs fixed and the subdirs
  746.        with extensions bug fixed. Some of the soss.zoo archives do
  747.        not contain these fixes.
  748.  
  749.     Q: What needs to be done so that Linux can run two ethernet cards?
  750.  
  751.     A: The easiest solution is to get 0.99pl13 or newer, as the hooks for
  752.        multiple ethercards are all there.
  753.        You can enable additional ethercards with LILO parameters such as:
  754.  
  755.         lilo: linux ether=5,0x300,0,1,eth0 ether=15,0x280,eth1
  756.  
  757.        These boot time arguments can be made permanent so that you
  758.        don't have to re-enter them every time. See the LILO manual.
  759.  
  760.     Q: Okay, I can run 2 cards -- can I run Linux as a gateway 
  761.        between two networks?
  762.  
  763.     A: This is really a question for the NET-HOWTO, but it is 
  764.        answered here anyways: Charles Hedrick (aka Mr. Slip)
  765.        had this to say:
  766.  
  767.        "Yes, however I'm a bit nervous about doing it. The problem isn't
  768.        functionality -- there's IP forwarding code, and as far as I know,
  769.        it works. Some people do use it. However routers need to be
  770.        particularly careful to avoid creating network problems such as
  771.        "meltdowns." The Linux IP layer doesn't have quite enough of these
  772.        protective features. It will only cause trouble if other hosts on
  773.        your network are misconfigured, and even then it probably won't
  774.        cause much trouble (assuming that only systems actually acting as
  775.        gateways are built with IP_FORWARD enabled). But I'd still rather
  776.        use a router that met all of the requirements of the host and
  777.        router requirements in the RFC's. (Note that not all other Unix
  778.        implementations do either. I'm concerned about things like not
  779.        sending ICMP responses to messages that arrive as media 
  780.        broadcasts. 386BSD looks OK, but older BSD-based implementations
  781.        often didn't do all of these checks.)
  782.  
  783.        It depends a lot on what the network is like and how critical it is.
  784.        For a home setup with a couple of hosts, I see no problem at all.
  785.        But I would not consider using Linux as a router on a large
  786.        campus network at the moment. I still think that by release 1.0,
  787.        Linux will be a reasonably well-behaved host. But I think use
  788.        as a router in critical situations should wait until somebody
  789.        has checked the ip and icmp modules for compliance with RFC 1009
  790.        and a few other specs."
  791.  
  792.     Q: I have /dev/eth0 as a link to /dev/xxx. Is this right?
  793.  
  794.     A: Contrary to what you have heard, the files in /dev/* are not used.
  795.        I originally thought that they might be an OK idea. I've since
  796.        concluded that they won't work, at least in the documented form.
  797.  
  798.     Q: Should I disable trailers when I "ifconfig" my ethercard?
  799.  
  800.     A: You can't disable trailers, and you shouldn't want to.
  801.        'Trailers' are a hack to avoid data copying in the
  802.        networking layers. The idea was to use a trivial 
  803.        fixed-size header of size 'H', put the variable-size header 
  804.        info at the end of the packet, and allocate all packets
  805.        'H' bytes before the start of a page. While it was a good
  806.        idea, it turned out to not work well in practice.
  807.        If someone suggests the use of '-trailers', note that it
  808.        is the equivalent of sacrificial goats blood. It won't do
  809.        anything to solve the problem, but if problem fixes itself then
  810.        someone can claim deep magical knowledge.
  811.  
  812. 9 Miscellaneous.
  813.  
  814.     Any other associated stuff that didn't fit in anywhere else gets
  815.     dumped here. It may not be relevant, and it may not be of general
  816.     interest but it is here anyway.
  817.  
  818. 9.01 Bad Vendors
  819.  
  820.     #define SOAPBOX
  821.  
  822.     There used to be some horror stories here about dealings with
  823.     Cabletron and Xircom. They were pretty ugly and gruesome.
  824.     Basically these companies are the ethernet equivalent of
  825.     what Diamond is to XFree86. They do not want to release
  826.     vital information on low-level programming of their hardware.
  827.     For something like Linux, where the source code for everything
  828.     is out in the open, this makes their hardware difficult or
  829.     impossible to use. However, like Diamond, when confronted
  830.     with the fact that they are losing sales from Linux/BSD users,
  831.     they basically shrug it off, saying that it is only a small
  832.     percentage of the total sales. If you can afford the time,
  833.     drop these vendors a note (via e-mail or snail-mail) and tell
  834.     them politely that the fact that they don't support open
  835.     software systems such as Linux has forced you to exclude them
  836.     from the vendors that you are purchasing hardware from. It may
  837.     not make any immediate difference, but it might make you feel
  838.     better. Besides, a few seconds of your time is a cheap price
  839.     to pay for *all* that free Linux software you are using. 8-)
  840.  
  841.     #undef SOAPBOX
  842.  
  843. 9.02 Closing
  844.  
  845.     If you have found any glaring typos, or outdated info in this
  846.     document, please let one of us know. It's getting big, and it
  847.     is easy to overlook stuff.
  848.  
  849.     Paul Gortmaker        <gpg109@rsphy1.anu.edu.au>
  850.     Donald J. Becker    <becker@super.org>
  851.  
  852.  
  853.